//
//  YGStatusBottomView.swift
//  sinaWeiBoGui
//
//  Created by liyonggui on 16/5/17.
//  Copyright © 2016年 liyonggui. All rights reserved.
//

import UIKit

/// 底部视图，显示三个按钮
class YGStatusBottomView: UIView {

    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        prepareUI()
    }
    
    private func prepareUI() {
//    backgroundColor = UIColor.greenColor()
        
        // 添加子控件
        addSubview(retweetButton)
        addSubview(commentButton)
        addSubview(zanButton)
        
        // 转发
        retweetButton.snp_makeConstraints { (make) -> Void in
            make.top.leading.bottom.equalTo(self)
        }
        
        // 评论
        commentButton.snp_makeConstraints { (make) -> Void in
            make.bottom.top.equalTo(self)
            make.leading.equalTo(retweetButton.snp_trailing)
            make.width.equalTo(retweetButton)
        }
        
        // 赞
        zanButton.snp_makeConstraints { (make) -> Void in
            make.top.trailing.bottom.equalTo(self)
            make.leading.equalTo(commentButton.snp_trailing)
            make.width.equalTo(retweetButton)
        }
    
    }
    
    // MARK: - 懒加载
    /// 转发
    private lazy var retweetButton: UIButton = UIButton(bkgImageName: "timeline_card_bottom_background", imageName: "timeline_icon_retweet", title: "转发")
    /// 评论
    private lazy var commentButton: UIButton = UIButton(bkgImageName: "timeline_card_bottom_background", imageName: "timeline_icon_comment", title: "评论")
    /// 赞
    private lazy var zanButton: UIButton = UIButton(bkgImageName: "timeline_card_bottom_background", imageName: "timeline_icon_unlike", title: "赞")
}
